[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = -1
guard.sparkno = -1
KO.echo = 0
volume = 0
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1.
ground.back = 8
ground.front = 8
air.back = 0
air.front = 0
height = 60
attack.dist = 999
proj.attack.dist = 999
proj.doscale = 0
head.pos = -5, -90 
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.71
walk.back = -2.71
run.fwd  = 4.6, 0
run.back = -4.5,-3.8
jump.neu = 0,-5.35
jump.back = -3.0416,-4.0416
jump.fwd = 3.0416,-4.0416
runjump.back = -2.55,-8.1
runjump.fwd = 4,-8.1
airjump.neu = 0,-8.1
airjump.back = -2.55
airjump.fwd = 2.5
air.gethit.groundrecover = -.15,-3.5
air.gethit.airrecover.mul = .5,.2
air.gethit.airrecover.add = 0,-4.5
air.gethit.airrecover.back = -1
air.gethit.airrecover.fwd = 0
air.gethit.airrecover.up = -2
air.gethit.airrecover.down = 1.5

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .44
stand.friction = .96
crouch.friction = .96
stand.friction.threshold = 2
crouch.friction.threshold = .05
air.gethit.groundlevel = 25
air.gethit.groundrecover.ground.threshold = -20
air.gethit.groundrecover.groundlevel = 10
air.gethit.airrecover.threshold = -1
air.gethit.airrecover.yaccel = .35
air.gethit.trip.groundlevel = 15
down.bounce.offset = 0, 20
down.bounce.yaccel = .4
down.bounce.groundlevel = 12
down.friction.threshold = .05

;---------------------------------------------------------------------------
; Vars:
;Var(1) = Air time during jumps
;Var(2) = Jump direction
;Var(4) = Dizzy counter
;Var(5) = "Juggle" counter

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Win
[Statedef 180]
type = S

[State 180, 2]
type = ChangeState
trigger1 = Time = 0
value = 181

;---------------------------------------------------------------------------
; Win
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 180, 1]
type = AssertSpecial
trigger1 = Time <= 55
flag = roundnotover

[State 181, 2]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 191, 3] 
type = ChangeState
trigger1 = !Time
value = 0

;---------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 200
poweradd = 1
sprpriority = 2

[State 200, 1]
type = HitDef
trigger1 = Var(5) < 2 && AnimElem = 2
attr = S, NA
damage = 38, 0
animtype = Light
guardflag = MAD
hitflag = HAFD
priority = 3, Hit
pausetime = 1,1
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
air.fall = 1
fall.recover = 0  

[State 200, 2]
type = PlaySnd
triggerall = P2BodyDist X >= 10
trigger1 = !Time
value = 0, 0
channel = 1

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing light kick
[Statedef 230]
type    = S
movetype= A
physics = S
poweradd= 11
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = !Time
value = 0, 1
channel = 1

[State 230, 2]
type = HitDef
trigger1 = Var(5) < 2 && AnimElem = 3
attr = S, NA
damage = 38, 0
animtype = Light
guardflag = MAD
hitflag = HAFD
priority = 3, Hit
pausetime = 1,1
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
air.fall = 1
fall.recover = 0  

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 400]
type    = C
movetype= A
physics = C
poweradd= 8
ctrl = 0
anim = 400
sprpriority = 2

[State 400, 1]
type = PlaySnd
trigger1 = !Time
value = 0, 0
channel = 1

[State 400, 2]
type = HitDef
trigger1 = !Var(5) && AnimElem = 2
attr = C, NA
damage = 38, 0
animtype = Light
guardflag = MAD
hitflag = MAFD
priority = 3, Hit
pausetime = 2,1
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
air.fall = 1
fall.recover = 0  

[State 400, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light kick
[Statedef 430]
type    = C
movetype= A
physics = C
poweradd= 11
ctrl = 0
anim = 430
sprpriority = 2

[State 430, 1]
type = PlaySnd
trigger1 = !Time
value = 0, 0
channel = 1

[State 430, 2]
type = HitDef
trigger1 = !Var(5) && !Time
attr = C, NA
damage    = 38
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 2,1
sparkno = -1
sparkxy = -10,-8
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
fall = 1
fall.recover = 0  

[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Punch
[Statedef 600]
type    = A
movetype= A
physics = N
poweradd= 5
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 1]
type = ChangeAnim
trigger1 = !Time && !Var(2)
value = 600
elem = ifelse(Var(1) < 36, ifelse(Var(1) < 24, (Var(1)/9 + 1),3), 3)

[State 600, 2]
type = ChangeAnim
trigger1 = !Time && Var(2)
value = 600
elem = ifelse(Var(1) < 30, ifelse(Var(1) < 24, 1, 3), 2)

[State 600, 3]
type = PlaySnd
trigger1 = !Time
value = 0, 0
channel = 1

[State 600, 4]
type = HitDef
trigger1 = !Var(5) && !Time
attr = A, NA
damage = 38, 0
animtype = Light
guardflag = MAD
hitflag = MAFD
priority = 3, Hit
pausetime = 1, 1
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
air.fall = 1
fall.recover = 0 

[State 600, 5]
type = ChangeAnim
trigger1 = Anim = 600 && AnimElemTime(3) = 9
value = 44+1*(Var(2) > 0)

[State 600, 6]
type = PosSet
trigger1 = Var(1) >= 35 && !Var(2) 
trigger2 = Var(1) >= 47 && Var(2) 
y = 0

[State 600, 7]
type = ChangeState
trigger1 = Var(1) >= 35 && !Var(2) 
trigger2 = Var(1) >= 47 && Var(2)  
value = 52
;---------------------------------------------------------------------------
;Jump Light Kick
[Statedef 630]
type    = A
movetype= A
physics = N
poweradd= 10
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = ChangeAnim
trigger1 = !Time && !Var(2)
value = 630
elem = ifelse(Var(1) < 36, ifelse(Var(1) < 27, (Var(1)/9 + 1),2), 3)

[State 630, 2]
type = ChangeAnim
trigger1 = !Time && Var(2)
value = 630
elem = ifelse(Var(1) < 30, ifelse(Var(1) < 24, 1, 2), 3)

[State 630, 3]
type = PlaySnd
trigger1 = !Time
value = 0, 0
channel = 1

[State 630, 4]
type = HitDef
trigger1 = !Var(5) && !Time
attr = A, NA
damage = 38, 0
animtype = Light
guardflag = MAD
hitflag = MAFD
priority = 3, Hit
pausetime = 1,1
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
air.fall = 1
fall.recover = 0 

[State 630, 5]
type = ChangeAnim
trigger1 = Anim = 600 && !AnimTime
value = 44+1*(Var(2) > 0)

[State 630, 6]
type = PosSet
trigger1 = Pos Y >= 0 
y = 0

[State 630, 7]
type = ChangeState
trigger1 = Pos Y >= 0 
value = 52

;---------------------------------------------------------------------------
;Throw - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Hit
sparkno = -1
p1sprpriority = 1
p1facing = 1
p2facing = 1
p1stateno = 810
p2stateno = 820
guard.dist = 0
fall = 1            

[State 800, 2]
type = PlaySnd
trigger1 = !Time
value = F7,0
channel = 1

[State 800, 3]
type = PlaySnd
trigger1 = Time = 3
value = F800,0
channel = 1

[State 800, 4]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Throw
[Statedef 810]
type    = S
movetype= A
physics = N
poweradd = 0

[State 810, 1]
type = PlaySnd
trigger1 = Time = 3
value = 800,0
channel = 1

[State 810, 2]
type = TargetBind
trigger1 = Time = 3
time = 1
pos = 5,0

[State 810, 3]
type = TargetBind
trigger1 = Time = 9
time = 1
pos = -4,0

[State 810, 4]
type = TargetBind
trigger1 = Time = 12
time = 1
pos = -14,0

[State 810, 5]
type = TargetBind
trigger1 = Time = 15
time = 1
pos = -22,-8

[State 810, 6]
type = TargetBind
trigger1 = Time = 15
time = 1
pos = -30,-16

[State 810, 7]
type = TargetBind
trigger1 = Time = 18
time = 1
pos = -12,-28

[State 810, 8]
type = TargetBind
trigger1 = Time = 21
time = 1
pos = 10,-46

[State 810, 9]
type = TargetBind
trigger1 = Time = 24
time = 1
pos = 28,-66

[State 810, 10]
type = TargetLifeAdd
trigger1 = !Time
value = -69

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 821, 1]
type = ChangeAnim2
Trigger1 = Time = 3
value = 820

[State 821, 2]
type = PosAdd
trigger1 = Time = 27
x = -18
y = -14

[State 821, 3]
type = PosAdd
trigger1 = Time = 30
x = -16
y = -10

[State 821, 4]
type = PosAdd
trigger1 = Time = 33
x = -14
y = -8

[State 821, 5]
type = PosAdd
trigger1 = Time = 36
x = -14
y = -6

[State 821, 6]
type = PosAdd
trigger1 = Time = 39
x = -12
y = -6

[State 821, 7]
type = PosAdd
trigger1 = Time = 42
x = -12
y = -2

[State 821,8]
type = Null
trigger1 = Time = 45
x = -10
y = 2

[State 0, Turn]
type = Turn
trigger1 = BackEdgeDist <= 10 && Time <= 60

[State 821, 8]
type = PosAdd
trigger1 = Time >= 45 && (GameTime % 3) = 0
x = -10
y = 2+(((Time - 45)/3) * 2)


[State 821, 3]
type = HitBy
trigger1 = 1
value = SCA,AP
time = 1

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Time > 27 && Pos Y >= 0
value = 5100 ;Hit ground

;---------------------------------------------------------------------------
; Hadouken
[Statedef 1000]
type    = S
movetype= A
physics = S
poweradd = 55
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = !Time
value = 1000,0
channel = 1

[State 1000, 2]
type = Helper
trigger1 = Time = 10
name = "Hadouken"
ID = 1000
stateno = 1001
pos = 48-24*(P2BodyDist X < 48),-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 1000, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Hadouken
[Statedef 1001]
type    = S
movetype= A
physics = N
velset = 5,0
anim = 1001
ctrl = 0
sprpriority = 2

[State 1001, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 1001, 2]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = 38
animtype  = Light
hitflag = MAFD
guardflag = MAFD
pausetime = 2,1
sparkno = -1
sparkxy = -10,-8
hitsound = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
fall = 1
fall.recover = 0  

[State 1001, 3]
type = AssertSpecial
trigger1 = (GameTime % 2) = 1
flag = invisible

[State 1001, 4]
type = ChangeState
trigger1 = MoveContact
value = 1002
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = FrontEdgeDist < -2
;---------------------------------------------------------------------------
; Hadouken
[Statedef 1002]
type    = S
movetype= A
physics = S
velset = 5,0
anim = 1002
ctrl = 0
sprpriority = 2

[State 1002, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 1002, 2]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 1002, 3]
type = DestroySelf
trigger1 = !AnimTime
;---------------------------------------------------------------------------
; Hurricane Kick
[Statedef 1050]
type    = A
movetype= A
physics = N
poweradd = 55
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

[State 1050, 1]
type = PlaySnd
trigger1 = !Time
value = 1050,0
channel = 1

[State 1050, 2]
type = HitDef
trigger1 = !Var(5)
attr = A, SA
damage = 108, 0
animtype = Light
guardflag = MAD
hitflag = MAFD
priority = 3, Hit
pausetime = 8, 8
sparkno = -1
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
fall = 1
fall.recover = 0 

[State 1050, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 821, 9]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Shoryuken (1)
[Statedef 1100]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 1100, 1]
type = PlaySnd
trigger1 = !Time
value = 0, 3
channel = 1

[State 1000, 2]
type = Helper
trigger1 = Time = 10
name = "Whip"
ID = 1000
stateno = 1101
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 1100, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Shoryuken (2)
[Statedef 1101]
type    = A
movetype= A
physics = N
anim = 1101
ctrl = 0
sprpriority = 2

[State 1101, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 1101, 2]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = 108
animtype  = Light
hitflag = MAFD
guardflag = MAFD
pausetime = 2,1
sparkno = -1
sparkxy = -10,-8
hitsound = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3.36
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.86, -3.83
air.hittime = 15
fall = 1
fall.recover = 0  

[State 1001, 3]
type = AssertSpecial
trigger1 = (GameTime % 2) = 1
flag = invisible

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime

;---------------------------------------------------------------------------
; Shinkuu Hadouken 1
[Statedef 3000]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2

[State 3000, 1]
type = PlaySnd
trigger1 = !Time
value = 0, 0
channel = 1

[State 0, Pause]
type = Pause
trigger1 = !Time
time = 73
movetime = 69

[State 3000, 2]
type = Explod
trigger1 = Time = 5
anim = 700
ID = 700
pos = 15,-62
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 3
ontop = 1
ownpal = 1
removeongethit = 1
supermovetime = 999
pausemovetime = 999

[State 3000, 3]
type = AssertSpecial
trigger1 = (Time >= 5 && Time < 69) && (GameTime % 2) = 1
flag = invisible

[State 3000, 4]
type = BGPalFX
trigger1 = Time = 4
time = 66
mul = 219,225,256

[State 3000, 5]
type = EnvColor
trigger1 = Time >= 6 && (GameTime % 8) = 6
value = 0,0,0
time = 4
under = 1

[State 3000, 6]
type = ChangeState
trigger1 = Time = 70
value = 3001
;---------------------------------------------------------------------------
; Shinkuu Hadouken 2
[Statedef 3001]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 3000, 1]
type = Helper
trigger1 = Time = 10
name = "Hadouken"
ID = 1000
stateno = 1001
pos = 48-24*(P2BodyDist X < 48),-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 3000, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 1050
;---------------------------------------------------------------------------
[Statedef 5300]
type    = S
movetype= H
physics = N
velset = 0,0
anim = 5120
ctrl = 0
sprpriority = 2

[State 5300, 1]
type = ChangeAnim
trigger1 = Time = 2
value = 5300

[State 5300, 2]
type = AssertSpecial
trigger1 = (GameTime % 2) = 1 && Time != 75
flag = invisible

[State 5300, 3]
type = Explod
trigger1 = Time = 1
anim = 701
ID = 5300
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = 73
scale = 1,1
sprpriority = 5
ownpal = 1

[State 5300, 4]
type = Turn
trigger1 = P2BodyDist X < -10

[State 5300, 5]
type = ChangeState
trigger1 = Time = 75
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = RoundState = 3 || RoundState = 4
flag = nomusic

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noairguard

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = AILevel
flag = nostandguard
flag2 = nocrouchguard

[State -2, Debug]
type = DisplaytoClipboard
trigger1 = 1
text = "Vel: x = %f y = %f Ryu by KingPepe. \nPos: x = %f y = %f Version: HUMMER TestVar: = %d"
params = fvar(20),fvar(21),fvar(22),fvar(23),Var(11)

[State -2, Vel X]
type = VarSet
trigger1 = 1
fvar(20) = Vel X

[State -2, Vel Y]
type = VarSet
trigger1 = 1
fvar(21) = Vel Y

[State -2, Pos X]
type = VarSet
trigger1 = 1
fvar(22) = Pos X

[State -2, Pos Y]
type = VarSet
trigger1 = 1
fvar(23) = Pos Y

[State -2, TestVar]
type = VarSet
trigger1 = 1
fvar(24) = ScreenPos Y

[State -2, VarAdd]
type = VarAdd
trigger1 = StateType = A && MoveType != H
var(1) = 1

[State -2, VarAdd]
type = VarSet
trigger1 = StateType != A || MoveType = H
var(1) = 1

[State 0, VarSet]
type = VarSet
trigger1 = StateNo != 3001
var(3) = 0

[State -2, Juggle Counter]
type = VarAdd
trigger1 = P2StateType = A && MoveHit = 1
var(5) = 1
ignorehitpause = 1

[State -2, Combo Counter]
type = VarSet
trigger1 = P2Movetype != H
var(5) = 0

[State -2, Remove Stars]
type = RemoveExplod
trigger1 = StateNo != 5300
id = 5300

[State -2, Projectile Flicker]
type = AssertSpecial
trigger1 = NumHelper(1000) && (GameTime % 2) = 0
flag = invisible

[State -2, VarAdd]
type = VarSet
trigger1 = RoundState = 2
var(10) = 0+1*(Command = "fwd")+2*(Command = "back")+4*(Command = "down")+8*(Command = "up")+40*(Command = "a")+80*(Command = "b")
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = !Var(11)
trigger1 = Var(10) = 4
var(11) = 29
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = Var(11) <= 29 && Var(11) > 0
trigger1 = Var(10) = 1 || Var(10) = 5 || Var(10) = 9
var(11) = 59
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = Var(11) < 29 && Var(11) > 0
trigger1 = Var(10) = 4
var(11) = 89
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = Var(11) < 59 && Var(11) > 30
trigger1 = Var(10) = 80
var(11) = 150
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = Var(11) <= 59 && Var(11) > 30
trigger1 = Var(10) = 40
var(11) = 151
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = Var(11) <= 89 && Var(11) > 30
trigger1 = Var(10) = 80
var(11) = 152
ignorehitpause = 1

[State -2, VarAdd]
type = VarAdd
trigger1 = Var(11) > 0 && Var(11) < 150
var(11) = -1
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
trigger1 = Var(11) = 30 || Var(11) = 60 || Var(11) = 90 || StateNo >= 1000 || StateType = A || NumHelper(1000) || MoveType = H
trigger2 = (Var(11) < 30 && Var(11)) && (Var(10) != 0 && Var(10) != 4)
trigger3 = (Var(11) < 60 && Var(11) > 30) && (Var(10) != 0 && Var(10) != 1 && Var(10) != 5 && Var(10) != 9 && Var(10) != 40 && Var(10) != 80)
trigger4 = (Var(11) < 90 && Var(11) > 60) && (Var(10) != 0 && Var(10) != 4)
var(11) = 0
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
triggerall = !Var(12)
trigger1 = Var(10) = 40 
var(12) = 6
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
trigger1 = Var(12) <= 6 && Var(12) > 0 && Var(10) = 80 
trigger2 = Var(10) = 120
var(12) = 150
ignorehitpause = 1

[State -2, VarAdd]
type = VarAdd
trigger1 = Var(12) > 0 && Var(12) < 150
var(12) = -1
ignorehitpause = 1

[State -2, VarAdd]
type = VarSet
trigger1 = StateNo = 3000 || StateType = A || NumHelper(1000) || MoveType = H
var(12) = 0
ignorehitpause = 1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

[State 20, 5]
type = Width
trigger1 = Anim = 20 || Anim = 21
player = -7,-7

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
value = 40, 0
channel = 1

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && StateNo < 1000
trigger1 = (Var(1) % 3) = 0 && Var(1) <= 18 && !Var(2)
y = -8-2*(Var(1) = 12)-4*(Var(1) = 9)-6*(Var(1) = 6)-8*(Var(1) = 3)

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && StateNo < 1000
trigger1 = (Var(1) % 3) = 0 && Var(1) > 18 && !Var(2)
y = 8+2*(Var(1) = 21)+4*(Var(1) = 24)+6*(Var(1) = 27)+12*(Var(1) = 30 || Var(1) = 33)

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && StateNo < 1000
trigger1 = (Var(1) % 3) = 0 && Var(1) <= 21 && Var(2)
y = -8+4*(Var(1) = 21)+2*(Var(1) = 18)-2*(Var(1) = 12)-4*(Var(1) = 9)-6*(Var(1) = 6)-8*(Var(1) = 3)

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && StateNo < 1000
trigger1 = (Var(1) % 3) = 0 && Var(1) > 21 && Var(2)
y = 8-4*(Var(1) = 21)-2*(Var(1) = 24||Var(1) = 27)+2*(Var(1) = 33)+4*(Var(1) = 36)+6*(Var(1) = 39)+12*(Var(1) = 42)+12*(Var(1) = 45)

[State -3, PosAdd]
type = PosAdd
trigger1 = StateNo = 50 && Time = 1
y = -20

[State -3, PosAdd]
type = Null
triggerall = StateType = A && MoveType != H
trigger1 = (Var(1) % 3) = 0 && ((Var(1) <= 18 && !Var(2)) || (Var(1) <= 24 && Var(2))) && StateNo != 40
trigger2 = StateNo = 50 && Time = 1
y = -15

[State -3, PosAdd]
type = Null
triggerall = StateType = A && MoveType != H
trigger1 = (Var(1) % 3) = 0 && ((Var(1) > 18 && !Var(2)) || (Var(1) > 24 && Var(2)))
y = 15

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && Var(1) % 3 = 0 && StateNo <= 1000
trigger1 = Var(2) = 1
x = 2+2*(Var(1) = 12 || Var(1) = 33)+4*(Var(1) = 15)+6*(Var(1) = 18 || Var(1) = 27 || Var(1) = 30)+8*(Var(1) = 21 || Var(1) = 24)

[State -3, PosAdd]
type = PosAdd
triggerall = StateType = A && MoveType != H && Var(1) % 3 = 0 && StateNo <= 1000
trigger1 = Var(2) = 2
x = -2-2*(Var(1) = 12 || Var(1) = 33)-4*(Var(1) = 15)-6*(Var(1) = 18 || Var(1) = 27 || Var(1) = 30)-8*(Var(1) = 21 || Var(1) = 24)

[State -3, VarAdd]
type = VarAdd
trigger1 = StateNo = 5000 && !Time
trigger1 = GetHitVar(animtype) != [3,5]
var(4) = 1

[State -3, VarAdd]
type = VarSet
trigger1 = StateNo = 5000 && !Time
trigger1 = GetHitVar(animtype) = [3,5]
trigger2 = StateNo = 5300
trigger3 = StateNo = 5100 && (PrevStateNo != [5000,5099])
var(4) = 0

[State -3, ChangeState]
type = ChangeState
trigger1 = StateNo = 5000 && HitShakeOver && Var(4) = 4 
value = 5030

[State -3, ChangeState]
type = ChangeAnim
trigger1 = StateNo = 5000 && Var(4) = 4 
value = 5030

[State -3, ChangeState]
type = ChangeState
trigger1 = StateNo = 5030 && Var(4) = 4 
trigger1 = HitOver
trigger2 = Vel Y > 0 && Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5035

[State -3, ChangeState]
type = ChangeState
triggerall = StateNo = 5035 && Var(4) = 4 
trigger1 = HitOver
trigger2 = AnimTime = 0
trigger3 = Vel Y > 0 && Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = !Time = 0 && Anim != 5035
value = 5050

[State -3, ChangeState]
type = ChangeState
trigger1 = StateNo = 5120 && Var(4) = 4
value = 5300
